<!DOCTYPE html>
<html>
<head>
    <title>CRUD Demo</title>
</head>
<body>
    <h1>User List</h1>

    <!-- 新增用户的表单 -->
    <form action="/add" method="post">
        <input type="text" name="name" placeholder="Enter name">
        <input type="text" name="pw" placeholder="Enter password">
        <input type="submit" value="Add">
    </form>

    <!-- 用户列表 -->
    <ul>
        {% for user in users %}
        <li>
            用户uid：{{ user.uid }}，用户名：{{ user.name }}

            <!-- 更新用户名的表单 -->
            <form action="/update/{{ user.uid }}" method="post" style="display:inline;">
                <input type="text" name="name" placeholder="Enter new name">
                <input type="submit" value="Update">
            </form>

            <!-- 删除用户的操作 -->
            <a href="/delete/{{ user.uid }}">Delete</a>
            
        </li>
        {% endfor %}
    </ul>

</body>
</html>
